package com.yixing.tech.system.service.impl;

import com.yixing.tech.common.base.BaseMongoDao;
import com.yixing.tech.common.base.BusinessException;
import com.yixing.tech.common.base.Page;
import com.yixing.tech.common.base.PageRow;
import com.yixing.tech.system.po.LoginLog;
import com.yixing.tech.system.service.ILogService;
import com.yixing.tech.common.vo.s3.LogInfo;
import com.yixing.tech.common.vo.s3.LogInfoVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author yixing tech
 * at 2021/12/20
 * describe：
 */
@Service
@Slf4j
public class LogServiceImpl implements ILogService {
    @Resource
    private BaseMongoDao baseMongoDao;


    @Override
    public void add(LogInfoVO logInfoVO) throws BusinessException {

    }

    @Override
    public void batchAdd(List<LogInfoVO> list) throws BusinessException {

    }

    @Override
    public LogInfoVO queryById(String id) {
        return null;
    }

    @Override
    public List<LogInfoVO> queryByIds(List<String> ids) {
        return null;
    }

    @Override
    public LogInfoVO queryByCondition(LogInfoVO logInfoVO) throws BusinessException {
        return null;
    }

    @Override
    public void update(LogInfoVO logInfoVO) throws BusinessException {

    }

    @Override
    public Page<LogInfoVO> list(PageRow<LogInfoVO> pageRow) {
        return baseMongoDao.listPage(pageRow,LogInfo.class,LogInfoVO.class);
    }

    @Override
    public List<LogInfoVO> list(LogInfoVO condition) {
        return baseMongoDao.list(condition,LogInfo.class,LogInfoVO.class);
    }

    @Override
    public void deleteById(String id) throws BusinessException {

    }

    @Override
    public void delete(List<String> ids) throws BusinessException {

    }

    @Async
    @Override
    public void logLogin(LoginLog loginLog) throws BusinessException {
        baseMongoDao.save(loginLog);
    }

//    @Override
//    public void update(Criteria criteria, Update update, Class c) throws BusinessException {
//        baseMongoDao.update(criteria,update,c);
//    }


}
